const path = require('path');//引入path模块
const resolve = dir => path.join(__dirname,dir)

module.exports = {
  chainWebpack:(config)=>{
    config.resolve.alias
      .set('@',resolve('./src'))
      .set('~',resolve(''))
  },
  // productionGzip:true,
  // productionGzipExtensions:['js','css'],
	publicPath: process.env.NODE_ENV === 'production' ? './' : '/',//不报错  但是页面是空的，这是history情况下会出现的问题，换成hash模式就不会出现这样的问题。
	outputDir: 'starRiverCupDist',
	assetsDir: "assets",
	productionSourceMap: false,
	filenameHashing: false,
	// lintOnSave: true,
	devServer: {
		hot: true,
		hotOnly: true,
		inline:true,
		disableHostCheck: true,
    historyApiFallback: true,
		proxy: {
			'/node': {
				target: "http://127.0.0.1:3000",
        ws: false,
				changeOrigin: true,
			},
      '/selectip':{
        target:'http://pv.sohu.com/cityjson?ie=utf-8'
      }
		},
	}
}